home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0153_SVGA Plotting that WORKS!.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  2KB  |  56 lines

  1. {
  2. > How do I set a pixel in that mode (800x600x256) ?
  3.  
  4. If the computer has a VESA driver installed, you can do it the same as you
  5. would for 320x200 (13h).  You would first change the video mode to the
  6. correct one and then plot the point.  The trouble is that every video card
  7. has different mode numbers for the different modes.
  8.  
  9.      Resolution       Manuf.      Mode #    Chip
  10.  
  11.      320x200          All         13h       All
  12.  
  13.      640x480          ATI         62h       All
  14.      640x480          Chips&Tech  79h       452,453
  15.      640x480          Paradise    5Fh       All
  16.      640x480          Trident     5Dh       All
  17.      640x480          Tseng       2Eh       All
  18.      640x480          Video7      67h       All
  19.      640x480          Genoa       5Ch       All
  20.  
  21.      800x600          ATI         63h       All
  22.      800x600          Chips&Tech  7Bh       453
  23.      800x600          Tseng       30h       All
  24.      800x600          Video7      69h       All
  25.  
  26.      1024x768         Trident     62h       8900
  27.      1024x768         Tseng       38h       ET4000
  28.  
  29.    Ploting a Pixel
  30.    ---------------
  31.  
  32.      To plot a pixel you would use the following Pascal Procedure:
  33. }
  34.  
  35. Procedure Plot(x,y:integer; color:byte); assembler;
  36. Asm
  37.   mov bh,0
  38.   mov cx,x { sets x coordinate }
  39.   mov dx,y { sets y coordinate }
  40.   mov al,color { sets color (0-255) }
  41.   mov ah,0Ch { tells video to plot a point }
  42.   int 10h
  43. End;
  44.  
  45. {
  46. The x coordinate is moved into cx, the y coordinate is moved into dx and
  47. the color is moved into al.  You must make sure that color is a BYTE
  48. variable.  It can go from 0-255.  When you pass the color, it either must
  49. be from a byte variable or it must be 'variable mod 256' (where
  50. 'variable' is some integer type variable).
  51.  
  52. This example uses inline assembler.  To do anything significant with the SVGA
  53. you either have to use assembler or find a good BGI file or unit that will do
  54. it for you.
  55. }
  56.